package com.treasure.mall.biz.remote.live;

import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.treasure.mall.biz.entity.live.LiveRoomPO;
import com.treasure.mall.zbq.common.base.ApiResult;

import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 *
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.service.core.live
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/6/11 20:19
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.service.core.live Inc. All rights reserved.
 */
public interface TencentLiveService {


    /**
     * 获取推流地址
     * 必须确保在1h内的有效访问
     *
     * @return 键名为协议名称，键值为url
     */
    Map<String, String> getPushUrl(LiveRoomPO room) throws TencentCloudSDKException, NoSuchAlgorithmException;

    /**
     * @return 获取播流地址
     */
    ApiResult setupPlayUrl(LiveRoomPO room);

    /**
     * 强行关闭流
     */
    void closeStream(LiveRoomPO room);


    /**
     * 检查直播间流是否是激活状态
     *
     * @param streamName 直播间streamName
     * @return
     */
    boolean describeLiveStreamState(String streamName);
}
